package com.woniu.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author WenXin
 * @version 1.0
 * @description: TODO
 * @date 2022/8/26 15:23
 */
//注册该类进入Spring容器
@Component
public class HelloWorld {
    @Value("${my.msg}")
    private String name;

    //通过该注解，可以将返回值注册进容器。类似
    // <bean id="chinese方法名" class="该类全限定类名">
    //      <args-constructor name="name" value="中国人">
    //</bean>
    @Bean
    public Chinese chinese() {
        return new Chinese(name);
    }
}
